<?php
require 'template/header.php';
?>

<div id="container">
    <?php
    require './db.php';
    $result = getProduct_Bepam();
    $result1 = getProduct_Bepduong();
    $result2 = getCategorie();
    ?>
    <div id="left-panel">
        <div class="left-stuff">
            <h3>DANH MỤC SẢN PHẨM</h3>
            <ul id="left-menu">
                <?php
                while ($row = mysql_fetch_array($result2)) {
                    ?>
                    <li><a href="#"><?php
                            echo $row['name'];
                            ?></a>
                        <ul class="list-menu">
                            <li><a href="#">Menu #1</a></li>
                            <li><a href="#">Menu #2</a></li>
                            <li><a href="#">Menu #3</a></li>
                            <li><a href="#">Menu #4</a></li>
                            <li><a href="#">Menu #5</a></li>
                        </ul>
                    </li>
                    <?php
                }
                ?>
            </ul>
        </div>	
    </div>

    <!--Nivo slider-->
    <div class="slider-wrapper theme-default">
        <div class="ribbon"></div>
        <div id="slider" class="nivoSlider">
            <img src="images/s1.jpg" alt="" />
            <a href="index.php"><img src="images/s2.jpg" alt="" title="#htmlcaption" /></a>
            <img src="images/s1.jpg" alt="" title="This is an example of a caption" />
            <img src="images/s2.jpg" alt="" />
        </div>
        <div id="htmlcaption" class="nivo-html-caption">
            <strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.
        </div>
    </div>
    <div id="content">

        <div class="products">
            <div class="products-title">
                <h3><a href="#">Bếp gas âm</a></h3>
                <ul>
                    <li><a href="#">Bếp gas âm Romal</a></li>
                    <li><a href="#">Bếp gas âm Rinnal</a></li>
                    <li><a href="#">Bếp gas âm Abbaka</a></li>
                    <li><a href="#">Bếp gas âm Faber</a></li>
                </ul>
            </div>
                <?php
                while ($row = mysql_fetch_array($result)) {
                ?>
                <div class="product">
                    <a href="product-detail.php?id=<?php echo $row['pro_id']; ?>"><img src="<?php echo $row['url']; ?>" /></a>
                    <a href="product-detail.php?id=<?php echo $row['pro_id']; ?>"><h4><?php echo $row['name']; ?></h4></a>
                    <i>Tiết kiệm: 1.480.000 VNĐ</i>
                    <p><?php echo number_format($row['price'], 0, ',', '.') . " VNĐ"; ?></p>
                </div>
                <?php
                }
                ?>

        </div>

        <div class="products">
            <div class="products-title">
                <h3><a href="#">Bếp gas dương</a></h3>
                <ul>
                    <li><a href="#">Bếp gas âm Romal</a></li>
                    <li><a href="#">Bếp gas âm Rinnal</a></li>
                    <li><a href="#">Bếp gas âm Abbaka</a></li>
                    <li><a href="#">Bếp gas âm Faber</a></li>
                </ul>
            </div>
            <?php
            while ($rows = mysql_fetch_array($result1)) {
                ?>
                <div class="product">
                    <a href="product-detail.php?id=<?php echo $rows['pro_id']; ?>"><img src="<?php echo $rows['url']; ?>" /></a>
                    <a href="product-detail.php?id=<?php echo $rows['pro_id']; ?>"><h4><?php echo $rows['name']; ?></h4></a>
                    <i>Tiết kiệm: 1.480.000 VNĐ</i>
                    <p><?php echo number_format($rows['price'], 0, ',', '.') . " VNĐ"; ?></p>
                </div>
                <?php
            }
            ?>
        </div>
    </div>
</div>

<?php
require 'template/footer.php';
?>

